<?php
/**
 * Created by PhpStorm.
 * User: jocky
 * Date: 2017/6/2
 * Time: 下午2:41
 */
?>
<div class="login_wrapper">
    <div class="animate form login_form">
        <section class="login_content" style="padding: 0;">
            <form id="form1" style="padding: 0 5px;">
                <input type="hidden" name="field＿name" value="<?=\Yii::$app->request->get('brokerId','0');?>">
                <h1>账 户 注 册 </h1>
                <div class="form-group">
                    <input name="alias" type="text" class="form-control"
                           placeholder="姓名"
                           data-error="请输入您的真实姓名"/>
                </div>
                <div class="form-group">
                    <input name="password" type="password" class="form-control"
                           placeholder="账户密码"
                           data-error="密码长度为6-12位，且至少包含大写字母、小写字母、数字和特殊字符中的任意两种类型"/>
                </div>
                <div class="form-group">
                    <input name="code" type="text" class="form-control"
                           placeholder="推荐码"
                           value="<?=\Yii::$app->request->get('brokerId','0')?\Yii::$app->request->get('brokerId','0'):""?>"
                           data-error="请输入上级代理提供的推荐码"/>
                </div>
                <div class="form-group" style=" margin-bottom: 5px;">
                    <?php
                    echo \yii\captcha\Captcha::widget([
                        'name' => 'captcha',
                        'captchaAction' => 'reg/captcha',
                        'template' => '{input}{image}',
                        'options' => [
                            'class' => 'form-control pull-left',
                            'style' => 'width: 68%;',
                            'placeholder' => "图片验证码",
                            'data-error' => '验证码不能为空',
                            'maxlength' => 4
                        ],

                        'imageOptions' => [
                            'id' => 'captchaImg1',
                            'alt' => '验证码',
                            'title' => '点击刷新',
                            'class' => 'pull-right',
                            'style' => 'width:30%;height:45px;cursor:pointer;border: solid 1px #dedede;',
                            'onclick' => 'getNewCaptcha(1)',
                        ]
                    ]);
                    ?>
                    <div class="clearfix"></div>
                </div>

                <div class="form-group">
                    <button type="button" class="form-control btn btn-primary" id="loginBtn" onclick="sendReg()">
                        注 册
                    </button>
                </div>

                <div class="form-group pull-right">
                    已有帐号？
                    <a href="/login" class="to_register" tabindex="-1"> 登录 </a>
                </div>
                <div class="clearfix"></div>

                <div class="separator">
                    <div style="margin-top: 20px;">
                        <p>
                            Copyright © 2018-<?= date('Y'); ?> All Rights Reserved
                        </p>
                    </div>
                </div>

                <?php
                echo \yii\helpers\Html::hiddenInput(
                    Yii::$app->request->csrfParam,
                    Yii::$app->request->getCsrfToken()
                );
                ?>
            </form>
        </section>
    </div>
</div>
